/*
 * ﻿Copyright (C) 2009-2013 NewMain Softech
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package com.newmainsoftech.gwetons.shared.logging;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.newmainsoftech.gwetons.client.logging.JsniLoggerWrapGinModule;
import com.newmainsoftech.gwetons.client.logging.LoggerWrapGinModule;
import com.newmainsoftech.gwetons.server.logging.LoggerWrapInjectorImpl;

/**
 * Definition of method signatures of Logger wrapper. <br />
 * At wrapping part implementation (such as {@link LoggerWrapInjectorImpl}, 
 * {@link LoggerWrapGinModule}), and {@link JsniLoggerWrapGinModule} classes), 
 * it is possible to switch to desired adaptation to preferable logging framework.<br /> 
 * Developed to have one central point to control/manage/customize Logger behavior.
 * 
 * @author <a href="mailto:artymt@gmail.com">Arata Y.</a>
 */
public interface LoggerWrap {
	Logger getLogger();
	String getLoggerName();
	
	void setLogger( Logger logger);
	Logger setUpLogger( String loggerName);
	
	void log( Level level, String message);
	void log( Level level, String message, Throwable throwable);
	void log( String levelStr, String message);
	
	void entering( String sourceMethod, Object[] params);
	
	/**
	 * This will be deprecated once the underneath Logger.entering method starts working as expected; 
	 * currently the Logger.entering method shows the unexpected result missing class name, method 
	 * name and parameter.
	 * @param args consists of information of entering method. <br />
	 * Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String: additional message such as method arguments</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element of  
	 * the additional message</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logEntering( Object... args);
	
	void exiting( String sourceMethod);
	void exiting( String sourceMethod, Object result);
	
	/**
	 * This will be deprecated once the underneath Logger.entering method starts working as expected; 
	 * currently the Logger.entering method shows the unexpected result missing class name, method 
	 * name and parameter.
	 * @param args consists of information of exiting method. <br />
	 * Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String representation of returned object</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element for 
	 * the returned object for the returning void case</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logExiting( Object... args);
}